package com.design.found.factory.abstractfactory;

/**
 * @ProjectName: design
 * @Package: com.design.found.factory.abstractfactory
 * @ClassName: FactoryProducer
 * @Author: shenaiguo
 * @Description: 创建一个工厂创造器/生成器类，通过传递形状或颜色信息来获取工厂。
 * @Date: 2020/4/18 0018 18:34
 */
public class FactoryProducer {

    public static AbstractFactory getFactory(String choice){
        if(choice.equalsIgnoreCase("SHAPE")){
            return new ShapeFactory();
        } else if(choice.equalsIgnoreCase("COLOR")){
            return new ColorFactory();
        }
        return null;
    }
}
